<template>
	<div class="inceter_right" >
		<aMian></aMian>
		<aTab :tabNac="tabNac" :static="static" @tabNacCiick="tabNacCiick"></aTab>
		<aList ref="getCamp"></aList>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				static:0,
				tabNac:[]
			}
		},
		mounted() {
			this.TagsGetList()
      this.static = this.$route.query.static
		},
		watch:{
			$route (to, from) {
				console.log('to.path----',to)//跳转后路由
				console.log('from----',from)//跳转前路由
				var that = this
				if(to){
					localStorage.setItem('tagId',to.query.id)
					that.$store.state.print.tagId = to.query.id
					that.static = to.query.static
					that.$refs['getCamp'].getCampusList()
				} else {
					localStorage.setItem('tagId',from.query.id)
					that.$refs['getCamp'].getCampusList()
					that.$store.state.print.tagId = from.query.id
				}
				console.log('from----',that.$store.state.print.tagId)//跳转前路由
			},
		},
		beforeDestroy() {
			this.$store.state.print.urlName = ''
			this.$store.state.print.ksName = ''
      this.$store.state.print.tagId = ''

		},
		methods:{
			tabNacCiick(i,item){
				this.static = i
				this.$store.state.print.ksName = item.name
        this.$store.state.print.tagId = item.id
        console.log('ssss',i,item)
				this.$refs['getCamp'].getCampusList()
			},
			TagsGetList(){
				var that = this
				var data = {
					categoryId:11,
				}
				that.$api.TagsGetList(data).then(res => {
					if(res.code == 200) {
						that.tabNac = res.data
						that.$store.state.print.tagId = res.data[0].id
						that.$store.state.print.ksName = that.tabNac[0].name
						that.$refs['getCamp'].getCampusList()
					}
				})
			},
		}
	}
</script>

<style scoped>
	span:hover{
		text-decoration: underline;
		cursor: pointer;
	}
	span{
		color: #666666;
	}
	label{
		color: #666666;
	}
	.inceter_right_cent{
		padding: 10px;
	}
	.inceter_right_cent_liIMg{
		display: flex;
		/* flex-wrap: wrap; */
		align-items: center;
		border-bottom: 1px solid #cccccc;
		padding: 10px 15px;
		font-size: 15px;
	}
	.dis{
		display: flex;
		align-items: center;
		width: 100%;
		justify-content: space-between;
	}
	.itemspan:hover{
		text-decoration: underline;
		color: #ea4410;
	}
	.item_img{
		margin-right: 10px;
	}
	.inceter_right_cent_liIMg img {
		width: 7px;
		height: 7px;
		margin-right: 20px;
	}
	p{
		margin-bottom: 10px;
	}
</style>
